/*
 * LCD1602 I2C 
   BMP280
 */
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#include "component_bmp280.h"


LiquidCrystal_I2C lcd(0x27, 16, 2);  //配置LCD地址及行列

void setup() {
  lcd.init();           //初始化LCD
  lcd.backlight();      //打开背光
  lcd.setCursor(5, 0);  //设置显示位置
  lcd.print("BMP280");  //显示字符数据
  setup_bmp280();
  delay(1000);
}

void loop() {
  loop_bmp280();
  // display temperature  & pressure
  String result_bmp280;
  result_bmp280 = "T=" + String(temperature, 1) + " P=" + String(pressure, 1) + "hPa";
  lcd.setCursor(0, 1);  //设置显示位置
  lcd.print(result_bmp280);
  delay(1000);
}